package Class.Advance.MethodReference.Practise.ComprehensivePractise;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Student2String {
    public static void main(String[] args) {
        List<Student> studentList = new ArrayList<>();
        Collections.addAll(studentList,
                new Student("Jack", 20),
                new Student("Nick", 24),
                new Student("Black", 18)
        );
        studentList.stream()
                .map(Student::toString)
                .forEach(System.out::println);
    }
}
